<template>
	<view class="ys">
		<view class="content" v-html="getContent(nodes)">

		</view>
	</view>
</template>

<script>
	import {
		ShopIntroduce,
	} from "@/api/api.js"
	export default {
		data() {
			return {
				id: '',
				nodes: ''
			}
		},
		onLoad(e) {
			if (e.id) this.id = e.id
			this.ShopIntroduce()
		},
		methods: {
			getContent(content) {
				let url = this.$config.websiteUrl
				let style = `style="max-width:100%;width:100%;display:block;"`
				if (typeof(content) == 'string')
					return content.replace(/src="\/ueditor/g, `${style} src="${url}/ueditor`)
			},
			ShopIntroduce() {
				ShopIntroduce({
					id: this.id
				}).then(res => {
					if (res.status == 1) {
						this.nodes = res.data
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		padding-top: 10px;
	}

	.content {
		min-height: 50vh;
		background: #fff;
		padding: 10px;
		border-radius: 10px;
		width: 96%;
		margin: 0 auto;
		box-sizing: border-box;
		max-width: 500px;
	}
</style>